﻿using BCCommon.Enums;
using BCEntity.TMS.HealthReport;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.HealthReport
{
    /// <summary>
    /// 健康上报数据层
    /// </summary>
    public interface IHealthReportData
    {
        /// <summary>
        /// 创建一条健康上报信息
        /// </summary>
        /// <param name="healthReportEntity">上报信息</param>
        /// <returns></returns>
        Task<HealthReportEntity> CreateAsync(HealthReportEntity healthReportEntity);

        /// <summary>
        /// 获取健康上报列表
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="start">上报时间开始时间</param>
        /// <param name="end">上报时结束时间</param>
        /// <param name="ascending">是否正序</param>
        /// <param name="index">页号</param>
        /// <param name="size">每页数据条数</param>
        /// <param name="userId">用户ID</param>
        /// <param name="role">角色</param>
        /// <param name="isFever">是否发烧</param>
        /// <param name="isCoughs">是否咳嗽</param>
        /// <returns></returns>
        Task<(IEnumerable<HealthReportEntity>, int)> GetListAsync(long? companyId, DateTime? start, DateTime? end, bool? ascending, int? index, int? size,long? userId, RoleType? role, bool? isFever, bool? isCoughs);        

        /// <summary>
        /// 查询最近（天数）的数据
        /// </summary>
        /// <param name="timeSpan"></param>
        /// <returns></returns>
        Task<IEnumerable<HealthReportEntity>> GetListByDays(int? timeSpan);

        /// <summary>
        /// 获取个人健康上报阈值列表
        /// </summary>
        /// <param name="timeSpan">时间间隔（天）</param>
        /// <param name="userId">用户ID</param>
        /// <param name="role">角色</param>
        /// <returns></returns>
        /// <returns></returns>
        Task<IEnumerable<HealthReportEntity>> GetAnalysisUserListAsync(int? timeSpan, RoleType role, long userId);
    }
}
